def addBinary(a, b):
    la = len(a) - 1
    lb = len(b) - 1
    s = ""
    add = "0"
    while la >= 0 and lb >= 0:
        if a[la] == "0" and b[lb] == "0":
            s = add + s
            add = "0"
        elif a[la] == "1" and b[lb] == "1":
            s = add + s
            add = "1"
        else:
            if add == "0":
                s = "1" + s
                add = "0"
            else:
                s = "0" + s
                add = "1"
        la -= 1
        lb -= 1
    while la >= 0:
        if a[la] == "0":
            s = add + s
            add="0"
        else:
            if add == "0":
                s = "1" + s
                add="0"
            else:
                s = "0" + s
                add = "1"
        la-=1
    while lb >= 0:
        if b[lb] == "0":
            s = add + s
            add="0"
        else:
            if add == "0":
                s = "1" + s
                add="0"
            else:
                s = "0" + s
                add = "1"
        lb-=1
    if add=="1":
        s="1"+s
    return s

def addBinary2(a,b):
    i=int(a,2)
    j=int(b,2)
    return bin(i+j)[2:]
print addBinary2("101111", "10")